import { postRequest, getRequest, postRequestOnlyData, postRequestJson } from '../utils/request'
// 路由管理
export const getRoutesList = <T>(data?: any): Promise<IResponseOnlyData<T>> =>
  postRequestOnlyData(`/sop/system/route/getRouteTree`, data)

export const addRoutes = <T>(data?: any): Promise<IResponsePost<T>> => postRequest(`/sop/system/route/saveRoute`, data)

export const editRoutes = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequest(`/sop/system/route/updateRoute`, data)

export const delRouteById = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/sop/system/route/deleteRoute`, data)

//应用管理
export const getAppList = <T>(data?: any): Promise<IResponseOnlyData<T>> =>
  postRequestOnlyData(`/sop/systemApplication/getApplicationList`, data)

export const addApp = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequest(`/sop/systemApplication/saveApplication`, data)

export const editApp = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequest(`/sop/systemApplication/updateApplication`, data)

export const delApp = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/sop/systemApplication/deleteApplication`, data)
